import React from 'react'
import { Redirect } from 'react-router-dom'

const FDiscover = React.lazy(()=>import('@/pages/discover'))
const FRecommend = React.lazy(()=>import('@/pages/discover/child-pages/recommend'))
const FSongDetail = React.lazy(()=>import('@/pages/player'))

const routes =[
  {path:"/",exact:true,render:()=> <Redirect to="/discover" />},
  {
    path:"/discover",
    component:FDiscover,
    routes:[
      {
        path:'/discover',
        exact: true,
        render: () => <Redirect to="/discover/recommend" />,
      },
      { path: '/discover/recommend', component: FRecommend },
      { path: '/discover/song', component: FSongDetail },
    ]
  }
]

export  default routes
